package org.hcf.data.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDate;

import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author xianiyitiao
 * @since 2024-05-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "ChatUser对象", description = "用户表")
public class ChatUser extends Model<ChatUser> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "user_id", type = IdType.INPUT)
    private Long userId;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "账号")
    private String account;

    @ApiModelProperty(value = "密码，加密方式为MD5")
    private String password;

    @ApiModelProperty(value = "密码盐")
    private String passwordSalt;

    @ApiModelProperty(value = "存头像图片地址")
    private String avatar;

    @ApiModelProperty(value = "生日")
    private LocalDate birthday;

    @ApiModelProperty(value = "所在区域")
    private String area;

    @ApiModelProperty(value = "个性签名")
    private String sign;

    @ApiModelProperty(value = "性别：1-男，0-女")
    private boolean gender;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "手机")
    private String phone;

    @ApiModelProperty(value = "状态：1-正常，2-冻结")
    private byte statusFlag;

    @ApiModelProperty(value = "登录次数")
    private Integer loginCount;

    /** 登录次数 */
    @ApiModelProperty(value = "登录次数")
    private long score;

    @ApiModelProperty(value = "登录秘钥:首次登录后才有")
    private String secret;

    @ApiModelProperty(value = "是否允许被搜索")
    private boolean isAllowSearch;

    @ApiModelProperty(value = "是否验证好友申请")
    private boolean isVerifyFriend;

    @ApiModelProperty(value = "最后登陆IP")
    private String lastLoginIp;

    @ApiModelProperty(value = "最后登陆时间")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(value = "删除标记：1-已删除，0-未删除")
    private boolean delFlag;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime modifyTime;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建人")
    private Long createUser;

    @ApiModelProperty(value = "更新人")
    private Long updateUser;

    @TableField(exist = false)
    private String qrCodeId;

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

}
